/*****************************************************************
 MYD Engine v0.1

 File: myd_entity.h
 Created: 12/06/09
*****************************************************************/

#ifndef MYD_ENTITY_H
#define MYD_ENTITY_H

#include "system/myd_system.h"
#include "graphics/myd_renderer.h"

namespace myd
{
	class Renderer;

	class MYD_API Entity
	{
		//const & dest
		public:
			Entity(Renderer *renderer);
			virtual ~Entity(void){};

			//properties
			void setRenderer(Renderer *renderer);
			void setName(std::string kName);
			const std::string& getName() const;
			bool isMoving;
		
			//position / rotation / dimension
			void setPos (float fX, float fY, float fZ);
			float getPosX() const;
			float getPosY() const;
			float getPosZ() const;

			void setRotation(float fRotationX, float fRotationY, float fRotationZ);
			float getRotationX() const;
			float getRotationY() const;
			float getRotationZ() const;

			void setDim(float fW, float fH, float fL);
			float getWidth() const;
			float getHeight() const;

			//methods
			virtual void draw();
			void update(float fTimeBetweenFrames);

			//collision
			void setCollisionable(bool set);
			void onCollide(Entity* tm_entity);

		protected:
			Renderer *renderer;

		private:
			std::string m_kName;
		
		//movement / transform
		public:
			void setSpeed(float speed);
			void setAngle(float angle);
			void setMoving(bool);
			
		private:
			float m_fX, m_fY, m_fZ;
			float m_fW, m_fH, m_fL;
			float m_fRotationX;
			float m_fRotationY;
			float m_fRotationZ;
			float m_fMovAngle, m_fMovAngleRad;
			float m_fMovSpeed;
		
		public:
			bool isCollisionable;

	};
	#include "myd_entity.inl"
}//end namespace
#endif //MYD_ENTITY_H
